--create Database YongTest
--go

use YongTest;



--CREATE TABLE customers
--  (
--     customerid INT IDENTITY (1, 1) PRIMARY KEY NOT NULL
--  )

--Create Table Orders
--(
--	customerid int  not null  foreign key  references customers (customerid),
--	orderid int identity (1,1) primary key not null,
--	OrderDate datetime not null DEFAULT (getdate()),
--	OrderDescription  Varchar(20) null
--)


IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[customers]') AND type in (N'U'))
Begin
	drop table orders 
	Print 'Table Orders Dropped';
End
Go


Create Table Orders
(
	customerid int  not null  foreign key  references customers (customerid),
	orderid int identity (1,1) primary key not null,
	OrderDate datetime not null DEFAULT (getdate()),
	OrderDescription  Varchar(20) null,
	RowGUID UniqueIdentifier ROWGUIDCOL constraint rowID default NEWSEQUENTIALID()

) 
with (
DATA_COMPRESSION = PAGE
)
print 'Table created' 

go




